/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package engine.entities.inventory;

import engine.entities.inventory.item.InventoryItem;

/**
 *
 * @author NathanT
 */
public class Inventory {
    
    public static final int PARTY_INVENTORY_ROWS = 7;
    public static final int PARTY_INVENTORY_COLUMNS = 18;
    public static final int PARTY_INVENTORY_SIZE = PARTY_INVENTORY_ROWS * PARTY_INVENTORY_COLUMNS;
    
    public static final int CONTAINER_INVENTORY_ROWS = 7;
    public static final int CONTAINER_INVENTORY_COLUMNS = 5;
    public static final int CONTAINER_INVENTORY_SIZE = CONTAINER_INVENTORY_ROWS * CONTAINER_INVENTORY_COLUMNS;
    
    protected final int rows;
    protected final int columns;
    protected final int size;
    protected final InventoryItem[][] items;
    
    public Inventory(int rows, int columns) {
        this.rows = rows;
        this.columns = columns;
        this.size = rows * columns;
        this.items = new InventoryItem[rows][columns];
    }
    
    public void setItem(int row, int column, InventoryItem item) {
        if (row >= rows || row < 0 || column >= columns || column < 0) {
            return;
        }
        items[row][column] = item;
    }
    
    public InventoryItem getItem(int row, int column) {
        if (row >= rows || row < 0 || column >= columns || column < 0) {
            return null;
        }
        return items[row][column];
    }
    
    public int getRowCount() {
        return rows;
    }
    
    public int getColumnCount() {
        return columns;
    }
    
    public int getSize() {
        return size;
    }
    
}
